package com.example.qxfw.tourqx.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.qxfw.common.entity.yj.IndustryWarning;
import com.example.qxfw.tourqx.mapper.IndustryWarningMapper;
import com.example.qxfw.tourqx.service.IndustryWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

@Service
public class IndustryWarningServiceImpl implements IndustryWarningService {

    @Autowired
    private IndustryWarningMapper industryWarningMapper;

    @Override
    public List<IndustryWarning> getList(String industryType, String dateChar1, String dateChar2) {
        return industryWarningMapper.selectList(Wrappers.<IndustryWarning>lambdaQuery()
                .eq(IndustryWarning::getIndustrytype,industryType)
                .between(IndustryWarning::getDatechar, Timestamp.valueOf(dateChar1),Timestamp.valueOf(dateChar2))
                .orderByDesc(IndustryWarning::getDatechar));
    }
}
